#include <bits/stdc++.h>

using namespace std;

int n,a,x[55];
long long f[5010];

int main (){
	scanf("%d %d",&n,&a);
	for(int i = 1;i <= n;i++) scanf("%d",&x[i]);
	f[2500] = 1;
	for(int i = 1;i <= n;i++){
		x[i] -= a;
		if(x[i] < 0){
			for(int j = -x[i];j <= 5000;j++)
				f[x[i] + j] += f[j];
		}else for(int j = 5000-x[i];j >= 0;j--)
				  f[x[i] + j] += f[j];
	}
	printf("%lld\n",f[2500]-1);
	return 0;
}
